package com.chijun.mform.field;

import com.chijun.mform.create.mode.FormField;
import com.chijun.mform.field.impl.FieldFor00FormId;
import com.chijun.mform.field.impl.FieldFor01DanHangText;
import com.chijun.mform.field.impl.FieldFor02DuoHangText;
import com.chijun.mform.field.impl.FieldFor03DanXiangXuanZe;
import com.chijun.mform.field.impl.FieldFor04DuoXiangXuanZe;
import com.chijun.mform.field.impl.FieldFor05Number;
import com.chijun.mform.field.impl.FieldFor06RiQi;
import com.chijun.mform.field.impl.FieldFor07RiQiQuJian;
import com.chijun.mform.field.impl.FieldFor08ShuoMingWenZi;
import com.chijun.mform.field.impl.FieldFor09ShenFenZheng;
import com.chijun.mform.field.impl.FieldFor10TuPian;
import com.chijun.mform.field.impl.FieldFor11JinE;
import com.chijun.mform.field.impl.FieldFor12FuJian;
import com.chijun.mform.field.impl.FieldFor13Position;
import com.chijun.mform.field.impl.FieldFor14JiSuanGongShi;
import com.chijun.mform.field.impl.FieldFor15LianXiRen;
import com.chijun.mform.field.impl.FieldFor16ShouXie;
import com.chijun.mform.field.impl.FieldFor17GuanLianBiaoDan;
import com.chijun.mform.field.impl.FieldFor18SaoMa;
import com.example.ccj.u.ToastUtils;

public class FieldFullViewUtil {

    public static BaseField getFieldModelByType(@FormField.FieldType int fieldType){
        BaseField baseField = null;
        switch (fieldType) {
            case FormField.FORM_ID:
                baseField = new FieldFor00FormId();
                break;
            //单行文字
            case FormField.TEXT_ONE:
                baseField = new FieldFor01DanHangText();
                break;
            //多行文字
            case FormField.TEXT_MULTI:
                baseField = new FieldFor02DuoHangText();
                break;
            //单项选择
            case FormField.DAN_XUAN:
                baseField = new FieldFor03DanXiangXuanZe();
                break;
            //多项选择
            case FormField.DUO_XUAN:
                baseField = new FieldFor04DuoXiangXuanZe();
                break;
            //数字
            case FormField.SHU_ZI:
                baseField = new FieldFor05Number();
                break;
            //日期
            case FormField.RI_QI:
                baseField = new FieldFor06RiQi();
                break;
            //日期区间
            case FormField.RI_QI_QU_JIAN:
                baseField = new FieldFor07RiQiQuJian();
                break;
            //说明文字
            case FormField.SHUO_MING_WEN_ZI:
                baseField = new FieldFor08ShuoMingWenZi();
                break;
            //身份证
            case FormField.SHEN_FEN_ZHENG:
                baseField = new FieldFor09ShenFenZheng();
                break;
            //图片
            case FormField.TU_PIAN:
                baseField = new FieldFor10TuPian();
                break;
            //金额
            case FormField.JIN_E:
                baseField = new FieldFor11JinE();
                break;
            //附件
            case FormField.FU_JIAN:
                baseField = new FieldFor12FuJian();
                break;
            //经纬度
            case FormField.JING_WEI_DU:
                baseField = new FieldFor13Position();
                break;
            //计算公式
            case FormField.JI_SUAN_GONG_SHI:
                baseField = new FieldFor14JiSuanGongShi();
                break;
            //联系人
            case FormField.LIAN_XI_REN:
                baseField = new FieldFor15LianXiRen();
                break;
            //手写
            case FormField.SHOU_XIE:
                baseField = new FieldFor16ShouXie();
                break;
            //关联表单
            case FormField.GUAN_LIAN_BIAO_DAN:
                baseField = new FieldFor17GuanLianBiaoDan();
                break;
            //扫码
            case FormField.ER_WEI_MA:
                baseField = new FieldFor18SaoMa();
                break;
            default:
                ToastUtils.showShort("不支持的字段" + fieldType);
                break;
        }

        return baseField;
    }
}
